package com.ali.service.impl;

import com.ali.service.RedisService;
import org.springframework.stereotype.Service;
import redis.clients.jedis.Jedis;

@Service
public class JedisServiceImpl implements RedisService {
    private static final Jedis jedis;

    static {
        jedis = new Jedis("192.168.88.172", 6379);
        jedis.auth("hello");
    }

    @Override
    public String set(String key, String value) {
        return jedis.set(key, value);
    }

    @Override
    public String get(String key) {
        return jedis.get(key);
    }
}